<template>
  <div class="infobox">
    <el-form :model="form" label-width="auto" :label-position="right">
      <el-form-item label="1.生命体征">
        <el-row>
          <el-col :span="4">
            <span class="inputtext">身高:</span>
            <el-input v-model="form.height" placeholder="" class="inputcalss" clearable />cm
          </el-col>
          <el-col :span="4">
            <span class="inputtext">体重:</span>
            <el-input v-model="form.weight" placeholder="" class="inputcalss" clearable />kg</el-col
          >
          <el-col :span="4">
            <span class="inputtext">腰围:</span>
            <el-input v-model="form.waistCircumference" placeholder="" class="inputcalss" clearable />cm</el-col
          >
          <el-col :span="4">
            <span class="inputtext">臀围:</span>
            <el-input v-model="form.hipCircumference" placeholder="" class="inputcalss" clearable />cm</el-col
          >

          <el-col :span="4">
            <span class="inputtext">收缩压:</span>
            <el-input v-model="form.bloodPressure" placeholder="" class="inputcalss" clearable />mmHg</el-col
          >
          <el-col :span="4">
            <span class="inputtext">舒张压:</span>
            <el-input v-model="form.diastolicPressure" placeholder="" class="inputcalss" clearable />mmHg</el-col
          >
          <el-col :span="4">
            <span class="inputtext">心率:</span>
            <el-input v-model="form.heartRate" placeholder="" class="inputcalss" clearable /> 次/分</el-col
          >
          <el-col :span="6">
            <span class="inputtext">握力:</span>
            <el-input v-model="form.gripStrengthLeft" placeholder="" class="inputcalss" clearable />kg</el-col
          >
        </el-row>
      </el-form-item>

      <el-form-item label="2.糖尿病史">
        <el-radio-group v-model="form.diabetesHistory" @change="tnbchange">
          <el-radio value="Y" size="large">有</el-radio>
          <el-radio value="N" size="large">无</el-radio>
        </el-radio-group>
        <el-select v-model="form.diabetesType" style="width: 150px; margin-left: 20px" :disabled="tnbtype">
          <el-option v-for="item in tnboptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
        </el-select>
      </el-form-item>

      <el-form-item label="3.病程">
        <el-input v-model="form.courseOfDisease" placeholder="" style="width: 200px" clearable />
      </el-form-item>

      <el-form-item label="4.既往史(可多选)">
        <el-checkbox-group v-model="form.pastMedicalHistoryIds" @change="jwschangenew">
          <el-checkbox
            v-for="option in insuranceOptions"
            :key="option.dictValue"
            :label="option.dictLabel"
            :value="option.dictValue"
          />
        </el-checkbox-group>
        <el-input v-model="form.pastMedicalRemark" placeholder="" style="width: 200px" clearable :disabled="jwsqt" />
      </el-form-item>
      <el-form-item label="5.药物过敏史" @change="ywgmschange">
        <el-radio-group v-model="form.drugAllergyHistory">
          <el-radio value="Y" size="large">有</el-radio>
          <el-radio value="N" size="large">无</el-radio>
        </el-radio-group>
        <el-input v-model="form.drugAllergyRemark" placeholder="" style="width: 200px" clearable :disabled="drugAllergyHistory" />
      </el-form-item>

      <el-form-item label="6.家族史" @change="jzschange">
        <el-radio-group v-model="form.familyHistory">
          <el-radio value="Y" size="large">有</el-radio>
          <el-radio value="N" size="large">无</el-radio>
        </el-radio-group>
        <el-input v-model="form.familyHistoryRemark" placeholder="" style="width: 200px" clearable :disabled="jzschecktype" />
      </el-form-item>

      <el-form-item label="7.当前治疗方式" @change="dqzlfschange">
        <el-checkbox-group v-model="form.currentTreatmentMethodIds">
          <el-checkbox v-for="option in tnbxqList" :key="option.dictValue" :label="option.dictLabel" :value="option.dictValue" />
        </el-checkbox-group>
      </el-form-item>

      <el-form-item label="8.运动习惯">
        <el-radio-group v-model="form.exerciseHabit">
          <el-radio v-for="option in exerciseOptions" :key="option.dictValue" :value="option.dictValue" size="large">
            {{ option.dictLabel }}
          </el-radio>
        </el-radio-group>
      </el-form-item>

      <el-form-item label="9.主要运动方式">
        <el-input v-model="form.mainExerciseMethod" placeholder="" style="width: 200px" clearable />
      </el-form-item>

      <el-form-item label="10.饮食习惯">
        <el-checkbox-group v-model="form.dietPreferenceIds">
          <el-checkbox
            v-for="option in eatListHabit"
            :key="option.dictValue"
            :label="option.dictLabel"
            :value="option.dictValue"
          />
        </el-checkbox-group>
      </el-form-item>

      <el-form-item label="11.吸烟史">
        <el-radio-group v-model="form.smokingHistory" @change="xybutton">
          <el-radio v-for="option in CheckOptions" :key="option.dictValue" :value="option.dictValue" size="large">
            {{ option.dictLabel }}
          </el-radio>
        </el-radio-group>

        <div class="xys">
          <el-radio-group v-model="form.smokingCessation" @change="xyjcbutton">
            <el-radio v-for="option in jcxxslist" :key="option.dictValue" :value="option.dictValue" size="large">
              {{ option.dictLabel }}
            </el-radio>
          </el-radio-group>
        </div>

        <div class="yjlclass">
          <span>每日</span>
          <el-input class="yjlclass" v-model="form.cigarettesPerDay" placeholder="" style="width: 200px" clearable />
          <span>支</span>
        </div>
      </el-form-item>

      <el-form-item label="12.饮酒史">
        <el-radio-group v-model="form.drinkingHistory" @change="yjlbbutton">
          <el-radio v-for="option in CheckOptions" :key="option.dictValue" :value="option.dictValue" size="large">
            {{ option.dictLabel }}
          </el-radio>
        </el-radio-group>

        <div class="xys">
          <el-radio-group v-model="form.drinkingCessation" @change="yjjcbutton">
            <el-radio v-for="option in jcxxslist" :key="option.dictValue" :value="option.dictValue" size="large">
              {{ option.dictLabel }}
            </el-radio>
          </el-radio-group>
        </div>

        <el-select v-model="form.drinkingCategory" style="width: 150px; margin-left: 20px">
          <el-option v-for="item in yjListHabit" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
        </el-select>

        <el-select v-model="form.drinkingFrequency" style="width: 150px; margin-left: 20px">
          <el-option v-for="item in yjpllist" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
        </el-select>

        <div class="xys">
          <span>饮酒量:</span>
          <el-input class="yjlclass" v-model="form.drinkingAmount" placeholder="" style="width: 200px" clearable />
          <span>毫升</span>
        </div>
      </el-form-item>

      <el-form-item label="13.职业">
        <el-radio-group v-model="form.occupation" @change="ybchangetwo">
          <el-radio v-for="option in zyxlOptions" :key="option.dictValue" :value="option.dictValue" size="large">
            {{ option.dictLabel }}
          </el-radio>
        </el-radio-group>
        <el-input v-model="form.occupationRemark" placeholder="" style="width: 200px" clearable :disabled="showzz" />
      </el-form-item>

      <div class="xlbox">
        <el-collapse v-model="activeNames" @change="handleChange" :expand-icon-position="iconposition">
          <el-collapse-item title="既往并发症" name="13" :disabled="tnbtype">
            <el-form-item label="1.急性并发症" @change="jfbzchange">
              <el-checkbox-group v-model="form.acuteComplicationsIds">
                <el-checkbox
                  v-for="option in jfbzlist"
                  :key="option.dictValue"
                  :label="option.dictLabel"
                  :value="option.dictValue"
                />
              </el-checkbox-group>
            </el-form-item>
            <el-form-item label="2.慢性并发症" @change="mxbfchange">
              <el-checkbox-group v-model="form.chronicComplicationsIds">
                <el-checkbox
                  v-for="option in mxbflist"
                  :key="option.dictValue"
                  :label="option.dictLabel"
                  :value="option.dictValue"
                />
              </el-checkbox-group>
            </el-form-item>

            <el-form-item label="3.血糖监测习惯">
              <el-radio-group v-model="form.bloodGlucoseMonitoringHabit">
                <el-radio value="Y" size="large">有</el-radio>
                <el-radio value="N" size="large">无</el-radio>
              </el-radio-group>
              <div v-if="form.bloodGlucoseMonitoringHabit == 'Y'" style="margin-left: 20px">
                <span>每周</span>
                <el-input v-model="form.bloodGlucoseMonitoringFrequency" placeholder="" class="inputcalss" clearable />
                <span>次</span>
                <span style="margin-left: 20px">有监测习惯标准：过去一个月内有血糖监测</span>
              </div>
            </el-form-item>

            <el-form-item label="4.血压监测习惯">
              <el-radio-group v-model="form.bloodPressureMonitoringHabit">
                <el-radio value="Y" size="large">有</el-radio>
                <el-radio value="N" size="large">无</el-radio>
              </el-radio-group>
              <div v-if="form.bloodPressureMonitoringHabit == 'Y'" style="margin-left: 20px">
                <span>每周</span>
                <el-input v-model="form.bloodPressureMonitoringFrequency" placeholder="" class="inputcalss" clearable />
                <span>次</span>
                <span style="margin-left: 20px">有监测习惯标准：过去一个月内有血压监测</span>
              </div>
            </el-form-item>
          </el-collapse-item>
        </el-collapse>
      </div>

      <div class="xlbox">
        <el-collapse v-model="activeNamestwo" @change="handleChange" :expand-icon-position="iconposition">
          <el-collapse-item title="生活习惯" name="13" :disabled="tnbtype">
            <el-form-item label="1.受教育程度">
              <el-radio-group v-model="form.educationLevel">
                <el-radio v-for="option in sjycd" :key="option.dictValue" :value="option.dictValue" size="large">
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group>
            </el-form-item>

            <el-form-item label="2.婚姻状况">
              <el-radio-group v-model="form.maritalStatus">
                <el-radio v-for="option in hxzkList" :key="option.dictValue" :value="option.dictValue" size="large">
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group>
            </el-form-item>

            <el-form-item label="3.家庭人均月收入（元）">
              <el-radio-group v-model="form.perCapitaIncom">
                <el-radio v-for="option in jtrj" :key="option.dictValue" :value="option.dictValue" size="large">
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group>
            </el-form-item>

            <el-form-item label="4.喝水情况">
              <span style="margin-left: 20px">您每天喝</span>
              <el-input v-model="form.drinkWaterVolume" placeholder="" style="width: 200px" clearable />
              <span style="margin-left: 20px">杯水（300mL为一杯）。</span>
            </el-form-item>

            <el-form-item label="5.您对目前的生活满意吗？">
              <el-radio-group v-model="form.lifeSatisfaction">
                <el-radio v-for="option in shmydOptions" :key="option.dictValue" :value="option.dictValue" size="large">
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group>
            </el-form-item>

            <el-form-item label="6.近些年您是否曾受过较大的精神创伤？">
              <el-radio-group v-model="form.psychologicalTrauma">
                <el-radio v-for="option in jscs" :key="option.dictValue" :value="option.dictValue" size="large">
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group>
              <span style="margin-left: 20px">具体说明</span>
              <el-input
                v-model="form.traumaDescription"
                placeholder=""
                style="width: 200px"
                clearable
                :disabled="form.psychologicalTrauma == 'N'"
              />
            </el-form-item>

            <el-form-item label="7.您的睡眠质量如何？">
              <el-radio-group v-model="form.sleepQuality">
                <el-radio
                  v-for="option in YZlist.sys_sleep_quality"
                  :key="option.dictValue"
                  :value="option.dictValue"
                  size="large"
                >
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group>
            </el-form-item>

            <el-form-item label="8.您每天的睡眠时间是？">
              <el-input v-model="form.sleepTime" placeholder="" style="width: 200px" clearable />
              <span style="margin-left: 20px">小时</span>
            </el-form-item>

            <el-form-item label="9.您失眠吗？">
              <el-radio-group v-model="form.insomnia">
                <el-radio v-for="option in YZlist.sys_yes_no" :key="option.dictValue" :value="option.dictValue" size="large">
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group>
            </el-form-item>

            <el-form-item label="10.您失眠的频率？">
              <el-radio-group v-model="form.insomniaFrequency">
                <el-radio
                  v-for="option in YZlist.sys_insomnia_frequency"
                  :key="option.dictValue"
                  :value="option.dictValue"
                  size="large"
                >
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group>
            </el-form-item>

            <el-form-item label="11.您有午休的习惯吗？">
              <el-radio-group v-model="form.noonBreak">
                <el-radio v-for="option in YZlist.sys_yes_no" :key="option.dictValue" :value="option.dictValue" size="large">
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="12.您一般午休多长时间？">
              <el-radio-group v-model="form.lunchBreakDuration">
                <el-radio
                  v-for="option in YZlist.sys_lunch_break_duration"
                  :key="option.dictValue"
                  :value="option.dictValue"
                  size="large"
                >
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="13.您认为自己的口腔健康状况如何？">
              <el-radio-group v-model="form.oralHealth">
                <el-radio v-for="option in YZlist.sys_oral_health" :key="option.dictValue" :value="option.dictValue" size="large">
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group>
            </el-form-item>

            <el-form-item label="14.您是否刷牙？ ">
              <el-radio-group v-model="form.brushing">
                <el-radio v-for="option in YZlist.sys_yes_no" :key="option.dictValue" :value="option.dictValue" size="large">
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group>
            </el-form-item>

            <el-form-item label="15.您的刷牙频率是？">
              <el-input v-model="form.brushingFrequency" placeholder="" style="width: 200px" clearable />
              <span style="margin-left: 20px">次/天</span>
            </el-form-item>

            <el-form-item label="16.您的刷牙时间是？">
              <!-- <el-radio-group v-model="form.brushingTimeIds">
                <el-radio
                  v-for="option in YZlist.sys_brushing_time"
                  :key="option.dictValue"
                  :value="option.dictValue"
                  size="large"
                >
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group> -->

              <el-checkbox-group v-model="form.brushingTimeIds">
                <el-checkbox
                  v-for="option in YZlist.sys_brushing_time"
                  :key="option.dictValue"
                  :label="option.dictLabel"
                  :value="option.dictValue"
                />
              </el-checkbox-group>
            </el-form-item>

            <el-form-item label="17.您认为您的口腔有异味吗？ ">
              <el-radio-group v-model="form.badBreath">
                <el-radio v-for="option in YZlist.sys_yes_no" :key="option.dictValue" :value="option.dictValue" size="large">
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group>
            </el-form-item>

            <el-form-item label="18.您现在是否有牙齿脱落？">
              <el-radio-group v-model="form.toothLoss">
                <el-radio v-for="option in YZlist.sys_yes_no" :key="option.dictValue" :value="option.dictValue" size="large">
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group>
              <span style="margin-left: 20px">已经脱落了</span>
              <el-input
                v-model="form.toothLossQuantity"
                placeholder=""
                style="width: 200px"
                clearable
                :disabled="form.toothLoss == 'N'"
              />
              <span style="margin-left: 20px">颗</span>
            </el-form-item>

            <el-form-item label="19.您口腔内酸味持续时间？ ">
              <el-radio-group v-model="form.sourDuration">
                <el-radio
                  v-for="option in YZlist.sys_sour_duration"
                  :key="option.dictValue"
                  :value="option.dictValue"
                  size="large"
                >
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group>
            </el-form-item>

            <el-form-item label="20.您口腔内酸味频率？ ">
              <el-radio-group v-model="form.sourFrequency">
                <el-radio
                  v-for="option in YZlist.sys_sour_frequency"
                  :key="option.dictValue"
                  :value="option.dictValue"
                  size="large"
                >
                  {{ option.dictLabel }}
                </el-radio>
              </el-radio-group>
            </el-form-item>

            <el-form-item label="21.口腔内酸味症持续月数 ">
              <el-input v-model="form.sourMonths" placeholder="" style="width: 200px" clearable />
              <span style="margin-left: 20px">月</span>
            </el-form-item>
          </el-collapse-item>
        </el-collapse>
      </div>

      <el-form-item>
        <div class="centerbox">
          <el-button type="primary" @click="onSubmit">保存</el-button>
        </div>
      </el-form-item>
    </el-form>
  </div>
</template>

<script setup>
import { ref, reactive } from "vue";
import { seekdataApi } from "@/api/system/system.js";
import { useRoute } from "vue-router";
import { AddbaseApi, getBaseInfoApi } from "@/api/hzmange/index.js";
import { ElMessage } from "element-plus";
const route = useRoute();
const routedata = reactive(route.query);
let insuranceOptions = ref([]);
let jzslist = [
  {
    id: 1,
    name: "糖尿病"
  },
  {
    id: 2,
    name: "高血压"
  },
  {
    id: 3,
    name: "心脏病"
  },
  {
    id: 4,
    name: "脑中风"
  },

  {
    id: 5,
    name: "肝病"
  },
  {
    id: 6,
    name: "肾病"
  },
  {
    id: 7,
    name: "痛风"
  }
];
let iconposition = ref("left");

let tnboptions = ref([]);
let tnbxqList = ref([]);
let jfbzlist = ref([]);
let mxbflist = ref([]);
let right = "right";
//给form里面的属性赋值为空
const form = ref({
  height: "", //身高
  weight: "", //体重
  waistCircumference: "", //腰围
  hipCircumference: "", //臀围
  bloodPressure: "", //血压
  heartRate: "", //心率
  gripStrengthLeft: "", //握力左
  diabetesHistory: "", //糖尿病史
  diabetesType: "", //糖尿病类型
  pastMedicalHistoryIds: [1], //既往史(可多选)
  //按照el-form属性赋值
  currentTreatmentMethodIds: [], //当前治疗方式
  exerciseHabit: "", //运动习惯
  mainExerciseMethod: "", //主要运动方法
  dietPreferenceIds: [], //饮食习惯
  smokingHistory: "", //吸烟史
  cigarettesPerDay: "", //每日吸烟量（支）
  smokingCessation: "",
  pastMedicalRemark: "", //其他输入框内容
  drugAllergyHistory: "N", //药物过敏史
  drugAllergyRemark: "", //药物过敏史备注
  smokingCategory: "", //吸烟类别
  smokingFrequency: "", //吸烟频次
  smokingAmount: "", //吸烟量
  drinkingCategory: "", //饮酒类别
  drinkingFrequency: "", //饮酒频次
  drinkingAmount: "", //饮酒量
  drinkingCessation: "", //戒除饮酒史
  occupation: "", //职业
  occupationRemark: "", //职业备注
  acuteComplicationsIds: [], //急性并发症
  chronicComplicationsIds: [], //慢性并发症
  bloodGlucoseMonitoringHabit: "Y", //血糖监测习惯
  bloodPressureMonitoringHabit: "Y", //血压监测习惯
  familyHistory: "N", //家族史
  familyHistoryRemark: "",
  bloodGlucoseMonitoringFrequency: "", //血糖监测频率
  bloodPressureMonitoringHabit: "", //血压监测频率
  brushingTimeIds: []
});
let showqt = ref(true); //医保类型其他有输入框
let showzz = ref(true); //.职业类型其他有输入框
let jwsqt = ref(true); //既往史(可多选)

const onSubmit = () => {
  form.value.id = routedata.id;

  AddbaseApi(form.value).then(res => {
    //code是200，提示保存成功
    if (res.code == 200) {
      ElMessage({
        message: "保存成功",
        type: "success"
      });
    }
  });
};
const ybchange = e => {
  let hasAaa = form.value.yblxcheckList.includes("其他");
  showqt.value = !hasAaa;
};
const jwschangenew = e => {
  let yyjw = form.value.pastMedicalHistoryIds.includes("1");
  //点击一下其他，其他输入框显示
  let hasAaa = form.value.pastMedicalHistoryIds.includes("11");
  jwsqt.value = !hasAaa;
  if (yyjw) {
    //点击一下以下皆无，其他输入框消失
    form.value.pastMedicalHistoryIds = ["1"];
    form.value.pastMedicalRemark = "";
  }
};
//职业类型
let ybchangetwo = e => {
  if (e == 5) {
    showzz.value = false;
  } else {
    showzz.value = true;
    form.value.occupationRemark = "";
  }
};
//既往史(可多选)
let jwslist = ref();
//药物过敏史
let drugAllergyHistory = ref(true);
let ywgmschange = () => {
  let hasAaa = form.value.drugAllergyHistory.includes("Y");
  if (hasAaa) {
    drugAllergyHistory.value = !hasAaa;
  } else {
    form.value.drugAllergyRemark = "";
    drugAllergyHistory.value = true;
  }
};
//家族史
let jzschecktype = ref(true);
let jzschange = () => {
  if (form.value.familyHistory == "Y") {
    jzschecktype.value = false;
  } else {
    form.value.familyHistoryRemark = "";
    jzschecktype.value = true;
  }
};
//糖尿病史
let tnbtype = ref(false);
let tnbchange = () => {
  let hasAaa = form.value.diabetesHistory.includes("Y");
  if (hasAaa) {
    tnbtype.value = false;
  } else {
    form.value.diabetesType = "";
    form.value.tnbfxnf = "";
    tnbtype.value = true;
  }
};

const activeNames = ref([]);
const handleChange = val => {};

//当前治疗方式
let dqzlfschange = () => {
  let one = form.value.currentTreatmentMethodIds.includes("6"); //以下全无
  if (one) {
    form.value.currentTreatmentMethodIds = ["6"];
  }
};
//急性并发症
let jfbzchange = () => {
  let one = form.value.acuteComplicationsIds.includes("5"); //以下全无
  if (one) {
    form.value.acuteComplicationsIds = ["5"];
  }
};
//慢性并发症

let mxbfchange = () => {
  let one = form.value.chronicComplicationsIds.includes("7"); //以下全无
  if (one) {
    form.value.chronicComplicationsIds = ["7"];
  }
};

let exerciseOptions = ref([]);
let eatListHabit = ref([]);
let xyListHabit = ref([]);
let yjListHabit = ref([]);
let CheckOptions = ref([]);
let jcxxslist = ref([]);
let yjpllist = ref([]);
//职业类型
let zyxlOptions = ref([]);
let sjycd = ref([]); //受教育程度
let hxzkList = ref([]); //婚姻状况
let jtrj = ref([]);
let shmydOptions = ref([]); //戒烟戒酒类型
let jscs = ref([]);

getYZlsit();
//阈值接口-获取下拉框数据
function fetchInsuranceData(dictType) {
  return seekdataApi({ dictType }).then(res => {
    return res.data.map(item => ({
      value: item.dictValue,
      label: item.dictLabel
    }));
  });
}

const YZlist = JSON.parse(sessionStorage.getItem("YZlist"));
CheckOptions.value = YZlist.sys_yes_no; //是否
zyxlOptions.value = YZlist.sys_occupation_type; //医保类型
exerciseOptions.value = YZlist.sys_exercise_habit; //运动习惯
eatListHabit.value = YZlist.sys_diet_preference;
jcxxslist.value = YZlist.sys_already_quit;
yjpllist.value = YZlist.sys_frequency;
yjListHabit.value = YZlist.sys_drinking_category;
insuranceOptions.value = YZlist.sys_past_medical_history;
tnboptions.value = YZlist.sys_diabetes_type;
tnbxqList.value = YZlist.sys_current_treatment_method;
jfbzlist.value = YZlist.sys_acute_complications;
mxbflist.value = YZlist.sys_chronic_complications;
sjycd.value = YZlist.sys_education_level; //受教育程度
hxzkList.value = YZlist.sys_marital_status; //婚姻状况
jtrj.value = YZlist.sys_per_capita_incom;
shmydOptions.value = YZlist.sys_life_satisfaction;
jscs.value = YZlist.sys_yes_no;
//获取下拉框数据方法封装

function getYZlsit() {}
getList();
function getList() {
  getBaseInfoApi({
    id: routedata.id
  }).then(res => {
    form.value = res.data;

    if (form.value.pastMedicalHistoryIds == null) {
      form.value.pastMedicalHistoryIds = [];
    }
    if (form.value.currentTreatmentMethodIds == null) {
      form.value.currentTreatmentMethodIds = [];
    }

    if (form.value.acuteComplicationsIds == null) {
      form.value.acuteComplicationsIds = [];
    }
    if (form.value.chronicComplicationsIds == null) {
      form.value.chronicComplicationsIds = [];
    }
    if (form.value.dietPreferenceIds == null) {
      form.value.dietPreferenceIds = [];
    }
  });
}
function xybutton() {
  form.value.smokingCessation = "";
}
function xyjcbutton() {
  form.value.smokingHistory = "";
}
function yjlbbutton() {
  form.value.drinkingCessation = "";
}

function yjbutton() {
  if (form.value.drinkingCategory) {
    form.value.drinkingCessation = "";
  }
}
function yjjcbutton() {
  if (form.value.drinkingCessation == "1") {
    form.value.drinkingHistory = "";
  }
}
</script>
<style scoped lang="scss">
.infobox {
  // height: 400px;
  overflow: auto;
}

.jwsclass {
  margin: 10px;
}
.centerbox {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.inputtext {
  margin-left: 10px;
  color: #606266;
}
.xys {
  margin-left: 20px;
  color: #606266;
}
.yjlclass {
  margin: 0 10px;
}
.inputcalss {
  margin: 0 3px;
  width: 80px;
}
.xlbox {
  position: relative;
}
:deep(.el-collapse-item__arrow) {
  font-weight: 300;
  margin: 0 8px 0 auto;
  transition: transform var(--el-transition-duration);
  position: absolute;
  left: 7%;
  color: #009688;
  font-size: 20px;
}
</style>
